package com.junmeng.jdemo.apng;

import android.content.Context;
import android.util.AttributeSet;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.widget.AppCompatTextView;

public class ApngTextView extends AppCompatTextView {
    private MyApngTextViewHelper myApngTextViewHelper;

    public ApngTextView(@NonNull Context context) {
        this(context, null);
    }

    public ApngTextView(@NonNull Context context, @Nullable AttributeSet attrs) {
        this(context, attrs, 0);
    }

    public ApngTextView(@NonNull Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
        myApngTextViewHelper = new MyApngTextViewHelper(this);
    }

    /**
     * @param text
     * @param size -1表示原图大小
     */
    public void setText(CharSequence text, int size) {
        myApngTextViewHelper.setText(text, size);

    }
}